// Copyright 2023 Innkeeper Lukexp(王晓平) &lt;37196496@qq.com>. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file. The original repo for
// this file is https://gitee.com/jetxt/jinyu.

package sms

type SmsIf interface {
	Send(mobile string, smsContent SmsContent) error
	SendBatch(mobiles []string, tpl string) error
	CommitTemplate(tpl *SmsTemplate) error
	CheckTemplate(tpl *SmsTemplate) error
}

type SmsContent interface {
	Encode() map[string]interface{}
	GetTpl() string
}

type SmsTemplate struct {
	Code    string
	Type    int
	Name    string
	Content string
	Remark  string
	Status  int // 模板状态，0待审核；1审核通过，2审核未通过
}

var smsIns SmsIf

func GetSmsIns() SmsIf {
	if smsIns == nil {
		smsIns = newAliSms()
	}
	return smsIns
}
